import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite';
import { resolve } from "path";
import ElementPlus from 'unplugin-element-plus/vite'

function pathResolve(dir) {
  return resolve(process.cwd(), ".", dir);
}

export default defineConfig({
  plugins: [
    vue(),
    AutoImport({
      imports: ['vue', 'vue-router'],
    }),
    ElementPlus({
      useSource: true,
    }),
  ],
  resolve: {
    alias: [
      {
        find: /@\//,
        replacement: pathResolve("src") + "/",
      },
    ]
  },
  css: {
    preprocessorOptions: {
      scss: {
        // additionalData: `@import "@/style/element-plus/index.scss";`,
      },
    },
  },
})
